//
//  UIButton+Extension.swift
//  小荣荣新浪微博
//
//  Created by zzr on 2018/4/27.
//  Copyright © 2018年 zzr. All rights reserved.
//

import UIKit

extension UIButton {
    class func cz_textButton(text: String, fontSize: CGFloat, normalColor: UIColor, highlightedColor: UIColor, backgounrImageName: String) -> UIButton {
        let btn = UIButton()
        btn.frame = CGRect(x:0, y:0, width:100, height:30)
        btn.setTitle(text, for: .normal)
        btn.setTitleColor(normalColor, for: .normal)
        btn.setTitleColor(highlightedColor, for: .highlighted)
        btn.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        btn.setImage(UIImage(named: backgounrImageName), for: .normal)
        btn.sizeToFit()
        return btn
    }
}
